package SQL.abysnSQL;
/*
 * tblref ::= ID:tn
		{:RESULT = new TblRef(tn);:}|
		ID:tn AS ID:new
		{:RESULT = new TblRef(tn,new);:}|
		LBRACE sql:s RBRACE AS ID:tn
		{:RESULT = new TblRef(s,tn;:};
 */
public class TblRef {
	public String tblName;
	public String alias;
	public SQL subquery;
	public TYPE type;
	
	public static enum TYPE{
		TABLENAME, SUBQUERY
	}
	
	public TblRef(String id){
		tblName = id;
		alias = null;
		type = TYPE.TABLENAME;
	}
	
	public TblRef(String id,String n){
		tblName = id;
		alias = n;
		type = TYPE.TABLENAME;
	}
	
	public TblRef(SQL s, String id){
		subquery = s;
		tblName = id;
		type = TYPE.SUBQUERY;
	}
}
